<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<html>

<body>
	<script type="text/javascript">
		function show_confirm() {
			var golden = $("#golden").val();
			var silver = $("#silver").val();
			
			if(golden ==0 && silver ==0){
				alert("k币数和分贝数不能都为0!");
				return false;
			}
			if(golden < 0 && silver < 0){
				alert("k币数和分贝数不能都小于0!");
				return false;
			}
			var r = confirm("是否确认要打K币吗？")
			if ( r == true ) {
				return true;
			} else {
				return false;
			} 
	
		}
	</script>
	<form id="banForm" class="form-inline" action="issueBatMoney.do" onsubmit="return show_confirm();">
		<textarea name="playerIds" rows=6 style="margin-left: 30px; width: 120px;">${playerIds}</textarea>
		<input type="text" class="input-small" placeholder="K币" name="golden" id="golden" value="${golden}"> 
		<input type="text" class="input-small" placeholder="分贝" name="silver" id="silver" value="${silver}">
		<input type="text" placeholder="备注" name="remark" value="${remark}">
		<input type="submit" value="打钱" />
	</form>

<form class="form-inline" action="queryBatMoney.do" method="post">
<table>
	<tr>
		<td>
			<label class="control-label" for="begtime">发送时间 :</label>
		</td>
		<td>
			<div class="controls">
				<div class="input-append datepicker" id="datetimepicker"   pickTime=true >
				    <input data-format="yyyy-MM-dd hh:mm" type="text" name="begtime" id="begtime" value="${begtime}"></input>
				    <span class="add-on">
				      <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
				    </span>
			  	</div>		 
			</div> 
		</td>	
		
		<td>
			<div class="controls">
				<div class="input-append datepicker" id="datetimepicker"   pickTime=true >
				    <input data-format="yyyy-MM-dd hh:mm" type="text" name="endtime" value="${endtime}" id="endtime"></input>
				    <span class="add-on">
				      <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
				    </span>
			  	</div>		 
			</div>
		</td>
		
		<td>
			<button type="submit" class="btn"> 查询 </button>
		</td>
		
	</tr>
</table>
</form>

	
	<table class="table table-bordered">
	  <thead>
	    <tr>
	      <th>时间</th>
	      <th>用户</th>
	      <th>K币</th>
	      <th>分贝</th>
	      <th>操作人</th>
	      <th>备注</th>
	    </tr>
	  </thead>
	  <tbody>
	  <c:forEach var="m" items="${list}">
	    <tr>
	      <td>${m.CreateAt}</td>
	      <td><tags:user id="${m.UserId}"/></td>
	      <td>${m.Gold}</td>
	      <td>${m.Silver}</td>
	      <td>${m.Operator}</td>
	      <td>${m.Remark}</td>
	    </tr>
	  </c:forEach>
	  </tbody>
	</table>
	<tags:page1 page="${page}" pageSize="${pageSize }" total="${total }" url="?begtime=${begtime}&endtime=${endtime}&page="/>
	
</body>

</html>